package com.geek.novel.vo

import com.geek.novel.entity.BookIndex
import com.geek.novel.entity.BookSection

/**
 * 爬取章节的返回结果
 */
open class CrawlerSectionVo {
	
	/**
	 * 状态码
	 */
	open var code: Int? = null

	/**
	 * 章节信息
	 */
	open var section: BookSection? = null

	/**
	 * 当前章节索引对象
	 */
	open var bookIndex: BookIndex? = null

	/**
	 * 当前章节索引的下标
	 */
	open var curSectionIndex: Int? = null

	/**
	 * 爬取的页码下标
	 */
	open var pageIndex: Int = 0


	companion object{
		fun of(bookIndex: BookIndex, section: BookSection?, code: Int): CrawlerSectionVo{
			val crawlerSectionVo = CrawlerSectionVo()
			crawlerSectionVo.curSectionIndex = bookIndex.indexNum
			crawlerSectionVo.code = code
			crawlerSectionVo.section = section
			crawlerSectionVo.bookIndex = bookIndex
			return crawlerSectionVo
		}
	}

}